<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ include file="includes/common.jsp" %>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title>${tag}文章</title>
        <meta name="search" content="article" />
        <meta name="author" content="chunhai.chen(15317227@qq.com)" />
        <meta name="description" content="肥猫 肥猫数据 ${tag}文章"  /> 
        <meta name="keywords" content="${tag}文章," />
		<c:set var="requester" value="<%=request.getServerName()+ (request.getServerPort()==80 ? "" : ":"+request.getServerPort())%>"/>
    </head>
    <body>
    
    <div class="box">‘${tag}’ 标签下的所有文章</div>
	
    <c:if test="${not empty articles}">
          <c:forEach items="${articles}" var="v" varStatus="vst">
			<div id="post-929" class="post">
            	<div class="date"><span><fmt:formatDate value="${v.statusUpdated }" pattern="yyyy"></fmt:formatDate></span><span class="f"><fmt:formatDate value="${v.statusUpdated }" pattern="MM-dd"></fmt:formatDate></span></div>
            	<h2><a rel="bookmark" href="/article/${v.uid}.htm" class="title">${v.name}</a></h2>
				<div class="info">
					<c:if test="${not empty v.author }">
					<span class="author"><a title="由 ${v.author.name } 发表" href="http://${v.author.blogUrl }">${v.author.name }</a></span>
					</c:if>
					<%--
                    <span class="categories">
                    	<a rel="category tag" title="查看 SEO探讨 的全部文章" href="/articles/seo.htm">SEO探讨</a>
                    </span>
                     --%>
                    <c:if test="${not empty v.tags }">
	                    <span class="tags">
		                    <c:forTokens var="tag" items="${v.tags }" delims=",; " ><a rel="tag" href="/articles/tag/${tag }.htm">${tag }</a>&nbsp;&nbsp;</c:forTokens>	                    	
	                    </span>
                    </c:if>
					<span class="comments">
						<a title="${v.name}上的评论" class="Comments off" href="/article/${v.uid}.htm#comments"><em>${v.commentCount}</em> 回复</a>
					</span>
					<div class="clear"></div>
				</div>
				<div class="intro">					 
					<c:choose>
					    <c:when test="${fn:length(v.longDesc) > 200}">${fn:substring(v.longDesc, 0, 200)} [......]</c:when>
				    	<c:otherwise>${v.longDesc}</c:otherwise>
					</c:choose>					  
					<p class="read-more"><a href="/article/${v.uid}.htm">继续阅读</a></p>
				</div>
            </div>
          </c:forEach>
    </c:if>
	

	
	<c:if test="${totalItems > pageSize}">
		<div id="Pagination" class="pagination"></div>
	
		<c:set var="requester" value="<%=request.getServerName()+ (request.getServerPort()==80 ? "" : ":"+request.getServerPort())%>"/>
		<script type="text/javascript" src="/js/jquery.pagination.js"></script>
 		<script type="text/javascript">
            /**
             * Callback function that displays the content.
             *
             * Gets called every time the user clicks on a pagination link.
             *
             * @param {int}page_index New Page index
             * @param {jQuery} jq the container with the pagination links as a jQuery object
             */
			function pageselectCallback(page_index, jq){
                // Replace old content with new content
				// $('#Searchresult').html(newcontent);
				// return false;
                
                return true;
            }
            

            // When document has loaded, initialize pagination and form 
            $(document).ready(function(){
            	var url="/articles/tag/${tag}.htm?pageNo=__id__&pageSize=${pageSize}";
				var totalItems = ${totalItems};
                var optInit = {
								callback: pageselectCallback,
								current_page: ${pageNo},
								link_to: url,
								items_per_page: ${pageSize},
								num_display_entries: 8,
								num_edge_entries: 2,
								prev_text: "上一页",
								next_text: "下一页"
							};
                $("#Pagination").pagination(totalItems, optInit);              
            });
            
        </script>
	</c:if>	
	
	
	
</body>
</html>